import request from '@/utils/request'

/** **
 * 新增角色
 * ***/
export function getRoleListAPI(data) {
  return request({
    url: '/sys/role',
    data
  })
}
export function addRoleAPI(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}
export function editRoleAPI(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}

// export function getRoleDetailAPI(id) {
//   return request({
//     url: `/sys/role/${id}`
//   })
// }
export function getRoleDetailAPI(id) {
  return request({
    url: `/sys/role/${id}`
  })
}
export function delRoleAPI(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'
  })
}
export function getEnableRoleListAPI() {
  return request({
    url: '/sys/role/list/enabled'
  })
}
export function editEnableRoleListAPI(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
export function assignPermAPI(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
